package com.zkthink.ceres.store.entity;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;



import java.math.BigDecimal;
import java.time.LocalDateTime;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 实体类 店铺表
 * </p>
 *
 * @author kellen
 * @since 2020-05-14
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_store")
@ApiModel(value = "Store", description = "店铺表")
@AllArgsConstructor
public class Store extends Entity<Long> {

  private static final long serialVersionUID = 1L;
  @TableField(value = "mid")
  private Long mid;

  /**
   * 店铺名称
   */
  @ApiModelProperty(value = "店铺名称")
  @Length(max = 200, message = "店铺名称长度不能超过200")
  @TableField(value = "store_name", condition = LIKE)
  @Excel(name = "店铺名称")
  private String storeName;

  /**
   * logo
   */
  @ApiModelProperty(value = "logo")
  @Length(max = 500, message = "logo长度不能超过500")
  @TableField(value = "logo", condition = LIKE)
  @Excel(name = "logo")
  private String logo;

  private Integer applyType;

  /**
   * 发货地址
   */
  @ApiModelProperty(value = "发货地址")
  @Length(max = 500, message = "发货地址长度不能超过500")
  @TableField(value = "ship_address", condition = LIKE)
  @Excel(name = "发货地址")
  private String shipAddress;

  /**
   * 店铺简介
   */
  @ApiModelProperty(value = "店铺简介")
  @Length(max = 500, message = "店铺简介长度不能超过500")
  @TableField(value = "remark", condition = LIKE)
  @Excel(name = "店铺简介")
  private String remark;

  /**
   * 注册手机号
   */
  @ApiModelProperty(value = "注册手机号")
  @NotEmpty(message = "注册手机号不能为空")
  @Length(max = 32, message = "注册手机号长度不能超过32")
  @TableField(value = "mobile", condition = LIKE)
  @Excel(name = "注册手机号")
  private String mobile;

  /**
   * 退货地址
   */
  @ApiModelProperty(value = "退货地址")
  @Length(max = 500, message = "退货地址长度不能超过500")
  @TableField(value = "refund_address", condition = LIKE)
  @Excel(name = "退货地址")
  private String refundAddress;

  /**
   * 退货联系电话
   */
  @ApiModelProperty(value = "退货联系电话")
  @Length(max = 32, message = "退货联系电话长度不能超过32")
  @TableField(value = "refund_tel", condition = LIKE)
  @Excel(name = "退货联系电话")
  private String refundTel;

  /**
   * 退货联系人
   */
  @ApiModelProperty(value = "退货联系人")
  @Length(max = 32, message = "退货联系人长度不能超过32")
  @TableField(value = "refund_contact", condition = LIKE)
  @Excel(name = "退货联系人")
  private String refundContact;

  /**
   * 店铺类型:1汽修店，2保养店，3美容店，4贴膜店，5洗车店，6轮胎更换店，7救援店，8加油站
   */
  @ApiModelProperty(value = "店铺类型:1汽修店，2保养店，3美容店，4贴膜店，5洗车店，6轮胎更换店，7救援店，8加油站")
  @NotNull(message = "店铺类型:1汽修店，2保养店，3美容店，4贴膜店，5洗车店，6轮胎更换店，7救援店，8加油站")
  @TableField("store_type")
  @Excel(name = "店铺类型:1汽修店，2保养店，3美容店，4贴膜店，5洗车店，6轮胎更换店，7救援店，8加油站")
  private Integer storeType;

  /**
   * 是否自动发送退货地址给买家 0否 1是
   */
  @ApiModelProperty(value = "是否自动发送退货地址给买家 0否 1是")
  @NotNull(message = "是否自动发送退货地址给买家 0否 1是不能为空")
  @TableField("is_auto_send_refund_address")
  @Excel(name = "是否自动发送退货地址给买家 0否 1是")
  private Integer isAutoSendRefundAddress;
  /**
   * 经度
   */
  @ApiModelProperty(value = "经度")
  @TableField("longitude")
  @Excel(name = "经度")
  private String longitude;
  /**
   * 纬度
   */
  @ApiModelProperty(value = "纬度")
  @TableField("latitude")
  @Excel(name = "纬度")
  private String latitude;
  @ApiModelProperty(value = "注册人注册省份")
  @TableField("province")
  @Excel(name = "注册人注册省份")
  private String province;

  @ApiModelProperty(value = "注册人注册市县")
  @TableField("city")
  @Excel(name = "注册人注册市县")
  private String city;

  @ApiModelProperty(value = "注册人注册区")
  @TableField("area")
  @Excel(name = "注册人注册区")
  private String area;


  @ApiModelProperty(value = "注册人注册省份")
  @TableField("province_code")
  @Excel(name = "注册人注册省份")
  private String provinceCode;

  /**
   * 所在市代码
   */
  @ApiModelProperty(value = "所在市代码")
  @TableField("city_code")
  private String cityCode;


  /**
   * 所在区代码
   */
  @ApiModelProperty(value = "所在区代码")
  @TableField("area_code")
  private String areaCode;

  @ApiModelProperty(value = "地址详情")
  @TableField("address")
  private String address;
  @ApiModelProperty(value = "订单数量")
  @TableField("order_quantity")
  private  Integer orderQuantity;

  @ApiModelProperty(value = "门店状态(1=正常 2=关闭)")
  @TableField("store_state")
  private  Integer storeState;
  
  /**
   * 到期时间
   */
  @ApiModelProperty(value = "到期时间")
  @TableField("expiration_time")
   @DateTimeFormat(pattern="yyyy-MM-dd")
  @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
  private LocalDateTime expirationime;
  /**
   * 联系电话
   */
  @ApiModelProperty(value = "联系电话")
  @TableField(value = "telephone", condition = LIKE)
  @Excel(name = "联系电话")
  private String telephone;

  /**
   * 营业时间
   */
  @ApiModelProperty(value = "营业时间")
  @TableField(value = "business_hours", condition = LIKE)
  @Excel(name = "营业时间")
  private String businessHours;
  /**
   * 店面照
   */
  @ApiModelProperty(value = "店面照")
  @TableField(value = "storefront_img", condition = LIKE)
  @Excel(name = "店面照")
  private String storefrontImg;

  /**
   * 店面背景图
   */
  @ApiModelProperty(value = "背景图")
  @TableField(value = "background_img", condition = LIKE)
  @Excel(name = "背景图")
  private String backgroundImg;

  /**
   * 营业额
   */
  @ApiModelProperty(value = "营业额")
  @TableField(value = "turnover", condition = LIKE)
  @Excel(name = "营业额")
  private BigDecimal turnover;
  
  @TableField(exist = false)
  private Integer userType;

  /**
   * 联系人姓名
   */
  @ApiModelProperty(value = "联系人姓名")
  @Length(max = 255, message = "联系人姓名长度不能超过255")
  @TableField(value = "contacts", condition = LIKE)
  @Excel(name = "联系人姓名")
  private String contacts;

  /**
   * 身份证号
   */
  @ApiModelProperty(value = "身份证号")
  @Length(max = 30, message = "身份证号长度不能超过30")
  @TableField(value = "id_num", condition = LIKE)
  @Excel(name = "身份证号")
  private String idNum;

  /**
   * 身份证反面照片
   */
  @ApiModelProperty(value = "身份证照片(,拼接正反面)")
  @Length(max = 255, message = "身份证照片长度不能超过255")
  @TableField(value = "id_imgs", condition = LIKE)
  @Excel(name = "身份证反面照片")
  private String idImgs;

  /**
   * 门店照片介绍(多张直接用,拼接)
   */
  @ApiModelProperty(value = "门店照片介绍(多张直接用,拼接)")
  @Length(max = 255, message = "门店照片介绍长度不能超过255")
  @TableField(value = "storeintro_img", condition = LIKE)
  @Excel(name = "门店照片介绍(多张直接用,拼接)")
  private String storeintroImg;

  @ApiModelProperty(value = "抽成比例")
  @TableField(value = "commission")
  private Double commission;
  /**
   * 评分
   */
  @TableField(exist = false)
  private Integer score;
  @ApiModelProperty(value = "1=删除")
  @TableField(value = "is_delete")
  private Integer isDelete;
  @Builder
  public Store(Long id, Long createUser, LocalDateTime createTime, Long updateUser,
      LocalDateTime updateTime,
      String storeName, String logo, String shipAddress, String remark, String mobile,
      String refundAddress, String refundTel, String refundContact,Integer storeType,
      Integer isAutoSendRefundAddress) {
    this.id = id;
    this.createUser = createUser;
    this.createTime = createTime;
    this.updateUser = updateUser;
    this.updateTime = updateTime;
    this.storeName = storeName;
    this.logo = logo;
    this.shipAddress = shipAddress;
    this.remark = remark;
    this.mobile = mobile;
    this.refundAddress = refundAddress;
    this.refundTel = refundTel;
    this.refundContact = refundContact;
    this.storeType=storeType;
    this.isAutoSendRefundAddress = isAutoSendRefundAddress;
  }

}
